package org.example.demo.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.example.demo.util.encrypt.EncryptTypeHandler;

import java.time.LocalDateTime;

@Data
@TableName(value = "user",autoResultMap = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class User {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String account;

    @TableField(value = "pwd", typeHandler = EncryptTypeHandler.class)
    private String pwd;

    private String name;

    private String  role;

    private String phone;


    private String avatarUrl;

    private String politicalStatus;

    private int age;

    private String gender;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    private String email;

    /**
     * 系
     */
    private String dept;

    /**
     * 身份证
     */
    private Long idCard;


}
